package icu.sehnen.es.service;

import icu.sehnen.es.entity.ESUser;
import icu.sehnen.es.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.elasticsearch.core.SearchHits;

import java.util.List;

/**
 * @author huangqing
 * @version 1.0
 * @date 2021/5/7 16:26
 */
public interface ESUserService {

    /**
     * 根据关键字搜索名称或者副标题
     */
    Page<ESUser> search(String keyword, Integer pageNum, Integer pageSize);

    /**
     * 高亮查询
     * @param keyword
     * @param pageNum
     * @param pageSize
     * @return
     */
    SearchHits searchHit(String keyword, Integer pageNum, Integer pageSize);

    User save(User user);

    Page<ESUser> findAll(Integer pageNum,Integer pageSize);

}